import React, { Component } from 'react'

const DetailData = [
  {id: 1, content: '你好，这是消息1的内容'},
  {id: 2, content: '你好，这是消息2的内容'},
  {id: 3, content: '你好，这是消息3的内容'},  
]

export default class Detail extends Component {
  render() {
    console.log(this.props);
    // 接收params参数
    const {id, title} = this.props.match.params;
    const findResult = DetailData.find(item => item.id == id);
    return (
      <div>
        <ul>
          <li>ID:{id}</li>
          <li>TITLE:{title}</li>
          <li>CONTENT:{findResult.content}</li>
        </ul>
      </div>
    )
  }
}
